import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'day',
    component: () => import('@/views/Day.vue')
  },
  {
    path: '/month',
    name: 'month',
    component: () => import('@/views/Month.vue')
  },
  {
    path: '/year',
    name: 'year',
    component: () => import('@/views/Year.vue')
  },
  // 404 路由
  {
    path: '/:pathMatch(.*)*', // 配置404路由
    name: 'notFound',
    redirect: '/'  // 重定向到首页
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
